//package com.wyd.flowable.config;
//
//import org.flowable.ui.common.security.FlowableUiSecurityAutoConfiguration;
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.config.http.SessionCreationPolicy;
//
///**
// * @author 王叶东
// * @since 2025/6/12 12:33
// */
//@Configuration
//@EnableWebSecurity
//// 关键：排除所有Flowable安全自动配置
//@EnableAutoConfiguration(exclude = {
//        FlowableUiSecurityAutoConfiguration.class,
////        FlowableIdmSecurityAutoConfiguration.class,
//        SecurityAutoConfiguration.class
//})
//public class DisabledSecurityConfig extends WebSecurityConfigurerAdapter {
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http
//                .csrf().disable()
//                .authorizeRequests()
//                .antMatchers("/**").permitAll()  // 允许所有请求
//                .and()
//                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)  // 无状态
//                .and()
//                .headers().frameOptions().disable();  // 允许iframe嵌入
//    }
//
//    // 禁用默认认证管理器
//    @Override
//    @Bean
//    public AuthenticationManager authenticationManagerBean() throws Exception {
//        return authentication -> {
//            throw new UnsupportedOperationException("Authentication is disabled");
//        };
//    }
//}
